package com.cn.pw.frame.service;

import java.util.List;

import org.springframework.dao.DataAccessException;

import com.cn.pw.frame.dao.entity.User;

public interface UserService {

	/**
	 * get user  by userName 
	 * 
	 * @return user
	 * @throws DataAccessException
	 */
	public User findUserByName(String trim) throws DataAccessException;
	
	/**
	 * get user  by id 
	 * 
	 * @return user
	 * @throws DataAccessException
	 */
	public User findUserById(Integer id) throws DataAccessException;
	
	/**
	 * init user and role
	 * 
	 * @return 
	 * @throws DataAccessException
	 */
	public void initUserRole(User user, String role) throws DataAccessException;

	/**
	 * get all users 
	 * 
	 * @return user list
	 * @throws DataAccessException
	 */
	public List<User> findUsers() throws DataAccessException;
	
	/**
	 * get user by user 
	 * 
	 * @return user list
	 * @throws DataAccessException
	 */
	public List<User> findUsers(User user) throws DataAccessException;

}
